#import "SEGQueryauthinfoModel.h"
#import <objc/runtime.h>

@implementation SEGQueryauthinfoMenuauthModel
-(instancetype)init{
    if (self == [super init]) {
        _authCode = @"";
    }
    return self;
}
#pragma mark - <NSCoding>
- (void)encodeWithCoder:(NSCoder *)encoder {
    unsigned int count = 0;
    objc_property_t *propertes = class_copyPropertyList([self class], &count);
    for (int i=0; i<count; i++) {
        const char *propertyName = property_getName(propertes[i]);
        NSString *name = [NSString stringWithUTF8String:propertyName];
        id value = [self valueForKey:name];
        [encoder encodeObject:(value)?value:@"" forKey:name];
    }
}

- (id)initWithCoder:(NSCoder *)decoder {
    if (self = [super init]) {
        unsigned int count =0;
        objc_property_t *propertes = class_copyPropertyList([self class], &count);
        for (int i = 0; i < count; i++) {
            const char *propertyName = property_getName(propertes[i]);
            NSString *name = [NSString stringWithUTF8String:propertyName];
            id value = [decoder decodeObjectForKey:name];
            [self setValue:(value)?value:@"" forKey:name];
        }
        
    }
    return self;
}
@end

@implementation SEGQueryauthinfoRoleauthmapModel
-(instancetype)init{
    if (self == [super init]) {
        _propId = @"";
        _custId = @"";
        _isAdmin = @"";
        _enterpriseUserId = @"";
        _communityId = @"";
        _enterpriseName = @"";
        _organId = @"";
        _enterpriseId = @"";
        _status = @"";
    }
    return self;
}
#pragma mark - <NSCoding>
- (void)encodeWithCoder:(NSCoder *)encoder {
    unsigned int count = 0;
    objc_property_t *propertes = class_copyPropertyList([self class], &count);
    for (int i=0; i<count; i++) {
        const char *propertyName = property_getName(propertes[i]);
        NSString *name = [NSString stringWithUTF8String:propertyName];
        id value = [self valueForKey:name];
        [encoder encodeObject:(value)?value:@"" forKey:name];
    }
}

- (id)initWithCoder:(NSCoder *)decoder {
    if (self = [super init]) {
        unsigned int count =0;
        objc_property_t *propertes = class_copyPropertyList([self class], &count);
        for (int i = 0; i < count; i++) {
            const char *propertyName = property_getName(propertes[i]);
            NSString *name = [NSString stringWithUTF8String:propertyName];
            id value = [decoder decodeObjectForKey:name];
            [self setValue:(value)?value:@"" forKey:name];
        }
        
    }
    return self;
}
@end

@implementation SEGQueryauthinfoDataModel
-(instancetype)init{
    if (self == [super init]) {
//        _menuAuth = [NSArray array];
        _userInfo = [[SEGQueryauthinfoRoleauthmapModel alloc]init];
    }
    return self;
}
#pragma mark - <NSCoding>
- (void)encodeWithCoder:(NSCoder *)encoder {
    unsigned int count = 0;
    objc_property_t *propertes = class_copyPropertyList([self class], &count);
    for (int i=0; i<count; i++) {
        const char *propertyName = property_getName(propertes[i]);
        NSString *name = [NSString stringWithUTF8String:propertyName];
        id value = [self valueForKey:name];
        [encoder encodeObject:(value)?value:@"" forKey:name];
    }
}

- (id)initWithCoder:(NSCoder *)decoder {
    if (self = [super init]) {
        unsigned int count =0;
        objc_property_t *propertes = class_copyPropertyList([self class], &count);
        for (int i = 0; i < count; i++) {
            const char *propertyName = property_getName(propertes[i]);
            NSString *name = [NSString stringWithUTF8String:propertyName];
            id value = [decoder decodeObjectForKey:name];
            [self setValue:(value)?value:@"" forKey:name];
        }
        
    }
    return self;
}

//+ (NSDictionary *)modelContainerPropertyGenericClass {
//    return @{@"menuAuth":SEGQueryauthinfoMenuauthModel.class};
//}

@end

@implementation SEGQueryauthinfoModel
-(instancetype)init{
    if (self == [super init]) {
        _message = @"";
        _data = [[SEGQueryauthinfoDataModel alloc]init];
        _code = @"";
    }
    return self;
}
#pragma mark - <NSCoding>
- (void)encodeWithCoder:(NSCoder *)encoder {
    unsigned int count = 0;
    objc_property_t *propertes = class_copyPropertyList([self class], &count);
    for (int i=0; i<count; i++) {
        const char *propertyName = property_getName(propertes[i]);
        NSString *name = [NSString stringWithUTF8String:propertyName];
        id value = [self valueForKey:name];
        [encoder encodeObject:(value)?value:@"" forKey:name];
    }
}

- (id)initWithCoder:(NSCoder *)decoder {
    if (self = [super init]) {
        unsigned int count =0;
        objc_property_t *propertes = class_copyPropertyList([self class], &count);
        for (int i = 0; i < count; i++) {
            const char *propertyName = property_getName(propertes[i]);
            NSString *name = [NSString stringWithUTF8String:propertyName];
            id value = [decoder decodeObjectForKey:name];
            [self setValue:(value)?value:@"" forKey:name];
        }
        
    }
    return self;
}
@end


